<!DOCTYPE html>
<?php include './validacao.php';?>
<html>
    <head>
        <meta charset="utf-8">        
        <title>. : Exercicio 3 : .</title>
        <link href="css/estilo.css" rel="stylesheet" type="text/css"/>
        <script>
            function refreshPagina() {
                document.location.reload();
            }
        </script>
    </head>
    <body>
        <h1>Calculadora de financiamento</h1>
        <?php echo "<h1 style='color:#ee0000;'>".$mensagem."</h1>";?>
        <div id="corpo">
            <form method="post">

                <!--parcela-->
                <div class="input">
                    <input class="number" 
                           type="number" 
                           step="any" 
                           value="<?php echo $parcela; ?>" 
                           name="ip_parcela" 
                           placeholder="Quantidade de parcelas"/>
                </div>

                <!--juros-->
                <div class="input">
                    <input class="number" 
                           type="number" 
                           step="any" 
                           value="<?php echo $juro; ?>" 
                           name="ip_juro" 
                           placeholder="Taxa de juro exemplo 2.2 (%)"/>
                </div>

                <!--valor da parcela-->
                <div class="input">
                    <input class="number" 
                           type="number"
                           step="any"
                           value="<?php echo $valorParcela; ?>" 
                           name="ip_valor_parcela" 
                           placeholder="Valor (R$) da parcela"/>
                </div>   

                <!--valor final total-->
                <div class="input">
                    <input id="Resulttotal" 
                           class="number" 
                           name="ip_valor_total" 
                           type="number" 
                           step="any"
                           value="<?php echo $total; ?>"
                           placeholder="Valor Financiado"/>
                </div>

                <!--botoes-->
                <div >
                    <input type="submit" value="Calcular" /> 
                    <input type="reset" value="Limpar" onclick="refreshPagina()"/>
                </div>

            </form>
        </div>
    </body>
</html>
